package com.china08.yxyapi.repository.mg.homework;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.homework.HomeworkQuesFavorite;

public interface HomeworkQuesFavoriteRepository extends MongoRepository<HomeworkQuesFavorite, String> {

    long countByTeacherIdAndQuesId(String userId, String id);

    Page<HomeworkQuesFavorite> findByTeacherIdAndStageAndSubjectAndDifficultyLevelAndQuesType(String userId,
            String phase, String subject, int level, String type, Pageable pageable);

    Page<HomeworkQuesFavorite> findByTeacherIdAndStageAndSubjectAndDifficultyLevel(String userId, String phase,
            String subject, int level, Pageable pageable);

    Page<HomeworkQuesFavorite> findByTeacherIdAndStageAndSubjectAndQuesType(String userId, String phase, String subject,
            String type, Pageable pageable);

    HomeworkQuesFavorite findByQuesIdAndTeacherId(String quesId, String teacherId);

    long countByTeacherId(String userId);

    long countByTeacherIdAndStageAndSubject(String userId, String phase, String subject);

    Page<HomeworkQuesFavorite> findByTeacherIdAndStageAndSubject(String userId, String phase, String subject,
            Pageable pageable);

    Page<HomeworkQuesFavorite> findByTeacherIdAndStageAndSubjectAndQuesTypeNotIn(String userId, String phase,
            String subject, List<String> ninType, Pageable pageable);

    long countByQuesId(String quesId);

}
